home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / BUTTONS / BUTTONS / README.TXT < prev   
Text File  |  1991-11-14  |  3KB  |  97 lines

  1. Bitmap Buttons   by Daniel Thomas  Donated to the public domain
  2.                  CIS: 72301,2164
  3.  
  4.  
  5. You should have 4 files:
  6.  
  7. ReadMe.txt    this file
  8. Buttons.pas   Bitmap Buttons unit
  9. ButnTest.pas  sample program
  10. ButnTest.res  sample resource file
  11.  
  12.  
  13. EXPLANATION:
  14. -----------
  15.  
  16. The Buttons Unit defines 2 objects for use in creating and handling Bitmap
  17. Buttons.  A button has 3 general appearances:
  18.  
  19.    Normal   ("up")
  20.    Pressed  ("down")
  21.    Disabled ("grayed")
  22.  
  23.    note: the other states, "selected" and "default" are not currently
  24.          handled - see the NOTES section, below
  25.  
  26. The tSingleBitmapButton object uses one bitmap, and draws lines to simulate
  27. the three states.  You create a single bitmap for the button, with a gray
  28. background.  You do not paint the "edges" or the border, but leave room for
  29. them in the gray background.  You can create the button bitmaps in virtually
  30. any size (within reason) - this holds true for tMultiBitmapButtons, also.
  31.  
  32. The tMultiBitmapButton object uses 3 bitmaps, one for each state.  The
  33. purpose for this object is to allow you complete control over how the
  34. button will look in each of its states.  For instance, a "pressed" button
  35. doesn't have to look like every other pressed button - be imaginative!
  36. You create each button in its entirety (don't you wish TPW had a spelling
  37. checker?), including the border and edges.  It would be advisable to make
  38. them all the same size (the object assumes that they are).
  39.  
  40.  
  41. EXAMPLES:
  42. --------
  43.  
  44. The sample program ButnTest.pas includes examples of both types of buttons.
  45. Just compile it and run.  In the sample program, clicking on one button will
  46. disable and re-enable the other button, so you can see what a "disabled"
  47. button looks like.
  48.  
  49. The ButnTest.res file has the bitmaps for these buttons.
  50.  
  51.  
  52. THINGS LEFT TO DO:
  53. ------------------
  54.  
  55. There isn't a keyboard interface.
  56.  
  57. There is nothing to differentiate a "default" button.  My suggestion
  58.   would be for tSingleBitmapButtons to draw a thicker border (thicker
  59.   towards the inside, not the outside), and tMultiBitmapButtons to have
  60.   an additional bitmap for this state - remember that the purpose of
  61.   tMultiBitmapButtons is to give total control to the programmer.
  62.  
  63. There is nothing to show a "selected" button.  In normal buttons, this is
  64.   shown by a dotted-line box around the text.  I would recommend something
  65.   like a dotted line box for tSingleBitmapButtons, and an additional bitmap
  66.   for tMultiBitmapButtons.
  67.  
  68. Painting on dialogs is not currently supported.  If you're going to take
  69.   into account changing system font sizes, etc, it can get complicated.
  70.   Have fun.
  71.  
  72.  
  73. FINAL NOTES:
  74. -----------
  75.  
  76. Finally, you are free to use this code in any way you wish.  No
  77. restrictions (although if you change something and post it to a BBS, please
  78. indicate your changes - I don't want someone blaming me for your lousy
  79. code <grin).
  80.  
  81. If you make any improvements, for instance the "things left to do", I would
  82. really appreciate it if you'd send them to me.  Some day I hope that this
  83. unit will be complete.  Right now, it does what *I* need it to do <grin>.
  84.  
  85. Dan Thomas
  86. 2301 N. Huron Circle
  87. Placentia, CA 92670
  88. (714) 524-5625
  89.  
  90. Compuserve: 72301,2164
  91. Prodigy:    CWRF01A
  92.  
  93. God bless.
  94.  
  95.  
  96. -Dan
  97.